<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui"
	template="../../templates/template-private.xhtml">

	<ui:define name="content">

		<h3>#{UsuarioMB.tituloPagina} Usuário</h3>
		
		<h:form>

			<p:wizard>
				<p:tab title="Geral">
					<p:panel style="border: none;">
						<h4 style="margin-bottom: 25px;">Informações gerais</h4>
						<p:outputLabel styleClass="labelForm">Nome <p:inputText
								required="true" maxlength="50" style="width:290px;"
								value="#{UsuarioMB.usuario.nome}" />
						</p:outputLabel>

						<p:outputLabel styleClass="labelForm">CPF <p:inputMask
								required="true" value="#{UsuarioMB.usuario.cpf}"
								styleClass="mask"
								style="margin-right:150px !important; width: 140px !important;"
								mask="999.999.999-99" />
						</p:outputLabel>

						<p:outputLabel styleClass="labelForm">E-mail <p:inputText
								required="true" maxlength="50" style="width:290px;"
								value="#{UsuarioMB.usuario.email}" />
						</p:outputLabel>

						<p:outputLabel styleClass="labelForm">
							Sexo 
							<p:selectOneMenu value="#{UsuarioMB.usuario.sexo}"
								required="true">
								<f:selectItem itemLabel="Selecione..." itemValue="" />
								<f:selectItem itemLabel="Masculino" itemValue="Masculino" />
								<f:selectItem itemLabel="Feminino" itemValue="Feminino" />
							</p:selectOneMenu>
						</p:outputLabel>

						<p:outputLabel styleClass="labelForm">
							Perfil 
							<p:selectOneMenu value="#{UsuarioMB.usuario.perfil}"
								required="true">
								<f:selectItem itemLabel="Selecione..." itemValue="" />
								<f:selectItem itemLabel="Solicitante" itemValue="Solicitante" />
								<f:selectItem itemLabel="Atendente" itemValue="Atendente" />
								<f:selectItem itemLabel="Administrador"
									itemValue="Administrador" />
							</p:selectOneMenu>
						</p:outputLabel>

						<p:outputLabel styleClass="labelForm">
							Nucleo 			
								<p:selectOneMenu required="true"
								value="#{UsuarioMB.usuario.nucleo}" converter="NucleoConverter">
								<f:selectItem itemLabel="Selecione..." itemValue="0" />
								<f:selectItems value="#{NucleoMB.listar()}" var="nucleo"
									itemLabel="#{nucleo.descricao}" itemValue="#{nucleo}" />
							</p:selectOneMenu>

						</p:outputLabel>


					</p:panel>
				</p:tab>

				<p:tab title="Acesso">
					<p:panel style="border: none; margin-bottom: 40px;">
						<h4 style="margin-bottom: 25px;">Informações de acesso</h4>


						<p:outputLabel styleClass="labelForm">Login <p:inputText
								required="true" requiredMessage="Digite seu login!" maxlength="20" style="width:290px;"
								value="#{UsuarioMB.usuario.login}" />
						</p:outputLabel>
						<p:outputLabel styleClass="labelForm">Senha <p:password
								required="true" maxlength="20" requiredMessage="Digite sua senha!" validatorMessage="Confirme sua senha corretamente!" match="pwd2" style="width:290px;"
								value="#{UsuarioMB.usuario.senha}" />
						</p:outputLabel>
						<p:outputLabel styleClass="labelForm">Confirmar <br />senha <p:password
								id="pwd2" maxlength="20" required="true" requiredMessage="Confirme sua senha!" style="width:290px; margin-top:-16px;"
								value="#{UsuarioMB.usuario.senha}" />
						</p:outputLabel>
						<p:outputLabel>
							<p:messages showDetail="true" autoUpdate="true" closable="true" />
							<p:commandButton style="float: right;margin-right: 323px;"
								action="#{UsuarioMB.salvar}"  value="#{NucleoMB.tituloPagina}"  />
						</p:outputLabel>

					</p:panel>
				</p:tab>
			</p:wizard>



		</h:form>

	</ui:define>

</ui:composition>